<template>
    <n-config-provider :theme-overrides="theme_overrides">
        <n-modal-provider>
            <n-message-provider class="h-full">
                <n-layout position="absolute" :native-scrollbar="false" class="h-full">
                    <n-layout-header style="height:64px;">
                        <HeaderComponent></HeaderComponent>
                    </n-layout-header>
                    <n-layout style="top:64px;height: calc(100% - 64px); border: 0; " position="absolute">
                        <n-scrollbar ref="scroll_ref" style="max-height: 1080px">
                            <router-view @scroll_to_top="scrollTop" />
                            <n-layout-footer>麟龙科技有限公司</n-layout-footer>
                        </n-scrollbar>
                    </n-layout>
                </n-layout>
            </n-message-provider>
        </n-modal-provider>
    </n-config-provider>
</template>



<script setup>
import HeaderComponent from './components/HeaderComponent.vue'
import { NConfigProvider } from 'naive-ui';
import { provide } from 'vue';
import { ref } from 'vue';



const scroll_ref = ref(null);
const theme_overrides = ref({
    common: {
        primaryColor: 'rgb(0,63,152)',
        primaryColorHover: 'rgb(0,43,102)',
        primaryColorPressed: 'rgb(0,63,152)',
        primaryColorSuppl: 'rgb(0,63,152)',
    },

})

provide(/* 注入名 */ 'scroll_to_top', /* 值 */ scrollTop);
function scrollTop(){
    scroll_ref.value.scrollTo({
  top: 0,
  behavior: "smooth"
    })
}

</script>